import CryptoJS from 'crypto-js';

export function encrypt(data) {
        let key = CryptoJS.enc.Latin1.parse('weir123456789876');
        let iv = CryptoJS.enc.Latin1.parse('123456789012weir');
        //加密
        let encrypted = CryptoJS.AES.encrypt(data, key, {
            iv: iv,
            mode: CryptoJS.mode.CBC,
            padding: CryptoJS.pad.ZeroPadding
        });
        return encrypted.toString;
    }